const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  configureWebpack: config => {
    if (process.env.NODE_ENV === 'development') {
      config.devtool = 'source-map'
    }
  },
  devServer: {
    proxy: {
      '/api': {
        target: 'https://likede2-java.itheima.net',
        changeOrigin: true

        // 路径重写
        /*  pathRewrite: {// 不是必须要配置的
          // 重新路由  localhost:8888/api/login  => www.baidu.com/login
          '^/api': ''
      } */
      }

    }
  }

})
